﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.RuntimeInitializeOnLoadMethodAttribute
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using UnityEngine.Scripting;

#nullable disable
namespace UnityEngine
{
  /// <summary>
  ///   <para>Allow a runtime class method to be initialized when a game is loaded at runtime
  /// without action from the user.</para>
  /// </summary>
  [RequiredByNativeCode]
  [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
  public class RuntimeInitializeOnLoadMethodAttribute : PreserveAttribute
  {
    private RuntimeInitializeLoadType m_LoadType;

    /// <summary>
    ///   <para>Creation of the runtime class used when Scenes are loaded.</para>
    /// </summary>
    /// <param name="loadType">Determine whether methods are called before or after the
    /// Scene is loaded.</param>
    public RuntimeInitializeOnLoadMethodAttribute()
    {
      this.loadType = RuntimeInitializeLoadType.AfterSceneLoad;
    }

    /// <summary>
    ///   <para>Creation of the runtime class used when Scenes are loaded.</para>
    /// </summary>
    /// <param name="loadType">Determine whether methods are called before or after the
    /// Scene is loaded.</param>
    public RuntimeInitializeOnLoadMethodAttribute(RuntimeInitializeLoadType loadType)
    {
      this.loadType = loadType;
    }

    /// <summary>
    ///   <para>Set RuntimeInitializeOnLoadMethod type.</para>
    /// </summary>
    public RuntimeInitializeLoadType loadType
    {
      get => this.m_LoadType;
      private set => this.m_LoadType = value;
    }
  }
}
